<template>
	<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px">
		<el-form-item label="商品规格" prop="spec_type">
			<div>
				<el-radio v-model="ruleForm.spec_type" :label="1">单规格</el-radio>
				<el-radio v-model="ruleForm.spec_type" :label="2">多规格</el-radio>
			</div>
			<!-- 单规格操作 -->
			<el-table v-if="ruleForm.spec_type == 1" :data="['']" border>
				<el-table-column label="供货价(元)" align="center">
					<template #default="{row}">
						<el-input placeholder="请输入供货价" />
					</template>
				</el-table-column>
				<el-table-column label="零售价(元)" align="center">
					<template #default="{row}">
						<el-input placeholder="请输入零售价" />
					</template>
				</el-table-column>
				<el-table-column label="划线价(元)" align="center">
					<template #default="{row}">
						<el-input placeholder="请输入划线价" />
					</template>
				</el-table-column>
				<el-table-column label="单位" align="center">
					<template #default="{row}">
						<el-select>
							<el-option :label="'台'" :value="'1'" />
						</el-select>
					</template>
				</el-table-column>
			</el-table>
			<div v-else>
				<el-button>添加规格项</el-button>
				<uiwu-spec></uiwu-spec>
			</div>
		</el-form-item>
		<el-form-item v-if="ruleForm.spec_type == 2" label="规格明细">
			<el-table :data="['']" border>
				<el-table-column label="供货价(元)" align="center">
					<template #default="{row}">
						<el-input placeholder="请输入供货价" />
					</template>
				</el-table-column>
				<el-table-column label="零售价(元)" align="center">
					<template #default="{row}">
						<el-input placeholder="请输入零售价" />
					</template>
				</el-table-column>
				<el-table-column label="划线价(元)" align="center">
					<template #default="{row}">
						<el-input placeholder="请输入划线价" />
					</template>
				</el-table-column>
				<el-table-column label="单位" align="center">
					<template #default="{row}">
						<el-select>
							<el-option :label="'台'" :value="'1'" />
						</el-select>
					</template>
				</el-table-column>
			</el-table>
		</el-form-item>
	</el-form>
</template>

<script>
	import uiwuSpec from './spec.vue'
	export default {
		components:{
			uiwuSpec
		},
		data(){
			return {
				ruleForm:{
					spec_type:1
				},
				rules:{}
			}
		}
	}
</script>

<style>
</style>